<?php
session_start();
ob_start('ob_gzhandler');
include 'config.php';

$dm = $_GET['danhmuc'];
$dm = explode('/',$dm);
$danhmuc = $dm[0]; $page = $dm[1];
$dt = $_GET['detail'];
$idMenu = $tc->id_menu($danhmuc);
if($danhmuc!='thu-vien') $detail = $tc->id_info($dt);
else $detail = $tc->id_menu($dt);

$tc->html($domain,$lang);

if(@$danhmuc and @$dt){
	$view = $tc->type_detail($idMenu,$detail,$domain);
	echo $view[0];//seo

	ob_start();
	echo $include = $view[1];//view Post
	$include = ob_get_clean();
}else if(@$danhmuc) {
	if($page=='') $page = 1; //else $page = $_GET['page'];
	settype($page, int);
	$view = $tc->type_catalog($idMenu,$domain,$page);
	echo $view[0];//seo

	ob_start();
	echo $include = $view[1];//view Post
	$include = ob_get_clean();
}else{
	$home = $tc->menu_one(home_page);
	$row_home = mysql_fetch_array($home);
	$title = $row_config['title'];
	$description = $row_home['metaDescription'];
	$keywords = $row_home['metaKeyword'];
	$image = '/images/logo.jpg';
	$url = $_SERVER['REQUEST_URI'];
	
	$tc->seo($domain,$title,$description,$keywords,$image,$url);
	
	ob_start();
	$include = include_once('blocks/home.php');
	$include = ob_get_clean();
}

$tc->css_script($css_script);
?>

<div id="top">
	<div style="width:1000px; margin:0 auto">
	<div id="search">
    <form action="" method="post" name="frmSearch" onSubmit="return SearchGoogle();" id="frmSearch">
        <input type="text" name="txtSearch" value="Nhập từ khóa..." id="key_search" style="width:180px; color:#666; font-style:italic; border:solid 1px #FFF; padding:2px 5px" onclick="if(txtSearch.value=='Nhập từ khóa...') txtSearch.value=''" onblur="if(txtSearch.value=='') txtSearch.value='Nhập từ khóa...'" />
		<input type="button" name="btnSearch" value=" GO " onClick="SearchGoogle();" style="font-weight:bold; padding:2px" />
    </form></div>
	<div id="lang"><a href="lang-vi.html"><img src="images/vi.jpg" alt="Tiếng Việt" /></a><a href="http://www.rehmi.org/institute-profile/"><img src="images/en.jpg" alt="Tiếng Anh" /></a></div>
    </div>
</div>
<div id="wrapper">
	<div id="main">
    	<div id="logo"><a href=""><img src="images/logo.jpg" alt="" /></a></div>
        <div id="menu"><?php  include_once('blocks/menu.php');?></div>
    </div>
	<?php include_once('blocks/slider.php');?>
	<div id="slogan"><h3>"<?php echo $row_config['slogan']; ?>" &nbsp;  &nbsp; </h3></div>
    <div style="clear:both; height:10px; background-color:#F1EBDD"></div>
    <div id="content">
	<?php
    if(!@$idMenu) echo $include;
    else{
		echo $include;
        include_once('blocks/right.php');
        echo '<div style="clear:both"></div>
        <div id="top_back"><a href="'.$_SERVER['REQUEST_URI'].'#">[Đầu trang]</a> &nbsp; - &nbsp; <a href="">[Trang trước]</a> &nbsp; 
		<div style="width:325px; height:1px; float:right; background-color:#FFF"></div></div>
        ';
	} //end if else
	?>
    </div><!--end content-->
    <div id="footer">
        <div id="foo1">VIỆN NGHIÊN CỨU KINH TẾ & QUẢN TRỊ NHÂN SỰ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</div>
        <div id="foo2">ECONOMIC RESEARCH AND HUMAN MANAGEMENT INSTITUTE &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</div>
        <div id="foo3"><?php echo $row_config['contact'];?><div style="clear:both"></div></div>
        
    </div>
</div><!--end wrapper-->
<script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js"></script>
<script type="text/javascript" src="website.js"></script>
<script type="text/javascript" src="assets/jquery.wt-rotator.min.js"></script>
<script type="text/javascript" src="assets/preview.js"></script>
<script type="text/javascript">
function SearchGoogle(){
	var key = document.getElementById("key_search").value;
	var site = document.domain;
	var qs = key + "+site:" + site;
	var url = "http://www.google.com.vn/#sclient=psy-ab&hl=vi&site=&source=hp&q=" + qs + "&pbx=1&oq=" + qs + "&aq=f&aqi=&aql=1&gs_sm=e";
	window.open(url, '_blank');
	return false;
}
</script>
<script type="text/javascript">
  (function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
  (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
  m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
  })(window,document,'script','//www.google-analytics.com/analytics.js','ga');

  ga('create', 'UA-40072775-1', 'rehmi.org');
  ga('send', 'pageview');

</script>
<?php
if($danhmuc=='thu-vien' && @$dt) echo '<script src="slider_pic/jquery.prettyPhoto.js" type="text/javascript" charset="utf-8"></script><script type="text/javascript">$(document).ready(function(){$(".gallery a[rel^=\'prettyPhoto\']").prettyPhoto({theme:\'facebook\'});});</script>';
?>
</body>
</html>
